#pragma once

#include <Windows.h>
#include <SDL.h>
#include <gl\GL.h>
#include <gl\GLU.h>
#include <btBulletDynamicsCommon.h>
#include <BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h>

#include "Camera.h"
#include "Model3D.h"
#include "Box.h"
#include "Terrain.h"

class Game
{
public:
	Game(int w, int h);
	~Game(void);

	void draw();
	void init();
	void render();
	btRigidBody* createSphere(float rad,float x,float y,float z,float mass);
	void renderSphere(btRigidBody* b);

	SDL_Surface * screen;
	bool running;
	Uint32 start;
	SDL_Event evt;

	Camera cam;
	float angle;

	Model3D box;
	Model3D floor;
	Model3D banner;

	Terrain * glTerrain;
	Box * e;

	btDiscreteDynamicsWorld * pWorld;
	btDispatcher* dispatcher;
	btBroadphaseInterface* pairCache;
	btConstraintSolver* solver;
	btCollisionConfiguration* config;

	btHeightfieldTerrainShape* terrain;
};

